//
//  DZSearchBar.m
//  Weico
//
//  Created by 大泽 on 15/7/21.
//  Copyright (c) 2015年 刘洪泽. All rights reserved.
//

#import "DZSearchBar.h"

@implementation DZSearchBar

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
      
        self.background = [UIImage imageNamed:@"searchbar_textfield_background"];
        
        UIImage *image = [UIImage imageNamed:@"searchbar_textfield_search_icon"];
        UIImageView *leftView = [[UIImageView alloc] init];
        leftView.image = image;
        
        leftView.size = CGSizeMake(30, 30);
        self.placeholder = @"请输入搜索内容";
        self.leftView = leftView;
        self.leftViewMode = UITextFieldViewModeAlways;
        leftView.contentMode = UIViewContentModeCenter;
        
    }
    return self;
}

+ (instancetype)searchBar
{
    return [[self alloc] init];
}

@end
